package com.day0930;
//  节点
public class Node {
    Node prev;//  上一个节点
    Object data;//  中间的数据
    Node next;//  下一个节点

    public Node(Node prev, Object data, Node next) {
        this.prev = prev;
        this.data = data;
        this.next = next;
    }

    public static void main(String[] args) {
        NewsManager newsManager3 = new NewsManager("罗志祥糊了","4","朝阳群众");
        Node four = new Node(null,newsManager3,null);
        NewsManager newsManager2 = new NewsManager("吴亦凡糊了","3","朝阳群众");
        Node third = new Node(null,newsManager2,four);
        NewsManager newsManager1 = new NewsManager("李云迪糊了","2","朝阳群众");
        Node second = new Node(null,newsManager1,third);
        NewsManager newsManager = new NewsManager("李易峰糊了","1","朝阳群众");
        Node first = new Node(null,newsManager,second);
//        Object f =  first.next.next.data;//  .next 找下一个节点
//        System.out.println(f);
        Node f = first;
        for (int i = 0; i < 2; i++) {
            f = f.next;
        }
        NewsManager news = (NewsManager)f.data;
        System.out.println(news);
    }
}
